package org.songwang.org.service.impl;

import org.songwang.basic.PageList;
import org.songwang.basic.query.BaseQuery;
import org.songwang.org.domain.Systemdictionarytype;
import org.songwang.org.mapper.ISystemdictionarytypeMapper;
import org.songwang.org.service.ISystemdictionarytypeservice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
@Service
@Transactional(readOnly = true,propagation = Propagation.SUPPORTS)
public class SystemdictionarytypeserviceImpl implements ISystemdictionarytypeservice {
    @Autowired
    private ISystemdictionarytypeMapper systemdictionarytypeMapper;
    @Override
    public List<Systemdictionarytype> findAll() {
        return systemdictionarytypeMapper.findAll();
    }

    @Override
    public Systemdictionarytype findById(Long id) {
        return systemdictionarytypeMapper.findById(id);
    }

    @Override
    @Transactional
    public void delete(Long id) {
        systemdictionarytypeMapper.delete(id);
    }

    @Override
    @Transactional
    public void add(Systemdictionarytype systemdictionarytype) {
        systemdictionarytypeMapper.add(systemdictionarytype);
    }

    @Override
    @Transactional
    public void update(Systemdictionarytype systemdictionarytype) {
        systemdictionarytypeMapper.update(systemdictionarytype);
    }

    @Override
    public PageList findQuery(BaseQuery query) {
        Long count = systemdictionarytypeMapper.count(query);
        List<Systemdictionarytype> query1 = systemdictionarytypeMapper.findQuery(query);
        return new PageList<>(count,query1);
    }

    @Override
    public Long count(BaseQuery query) {
        return systemdictionarytypeMapper.count(query);
    }
}
